package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.mallbean.Category;
import com.cskaoyan.service.mallservice.CategoryService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.wx.WxCatalogCurrentVo;
import com.cskaoyan.vo.wx.WxCatalogIndexVo;
import com.fasterxml.jackson.databind.ser.Serializers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: feisl
 * @Date: 2021/5/12 22:27
 */
@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {
    @Autowired
    CategoryService categoryService;

    @RequestMapping("index")
    public BaseRespVo index() {

        WxCatalogIndexVo wxCatalogIndexVo = categoryService.index();

        return BaseRespVo.ok(wxCatalogIndexVo);
    }

    @RequestMapping("current")
    public BaseRespVo current(Integer id) {

        WxCatalogCurrentVo current = categoryService.current(id);

        return BaseRespVo.ok(current);
    }
}
